
<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
	<meta charset="utf-8">
    <title>Broker/Customer Page</title>
<?php echo link_tag(my_url().'skin.css'); ?>
<script type="text/javascript" src="<?php echo my_url(); ?>js/1.js"></script>
<script type="text/javascript" src="../js/1.js"></script>
<script src="<?php echo my_url(); ?>js/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="<?php echo my_url(); ?>js/trhighlight.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
 var BaseURL='<?php echo base_url(); ?>';

function confirmDelete(broker_code){
	var x= window.confirm("Are you sure to delete this item?");
	if(x){
		window.location.href = BaseURL + "bc/delete_bc/" + broker_code;
	}	
}
</script>
<link rel="stylesheet" href="../skin.css" type="text/css" media="screen" /><meta name="author" content="Jaypee Mahilum" />
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<link href="skin.css" rel="stylesheet" type="text/css" />
</head>
<?php
//echo $_SESSION['administrator_log']."============";
if(!isset($_SESSION['administrator_log']))
{
	echo"Log in first to access this page<html><title>WARNING</title><body><br><a href='".base_url()."administrator' />click here to log in.</a></body></html>";
}
else
{
?>
<?php
if(isset($debug))
{
	echo "<h2> $debug </h2>";
	exit;
}

?>
<body >

	<div class="BodyCover">
 		<div class="ParentContent">
	        <?php require("at_menu.php"); ?>
			<div class="MenuTab">
    			<div class="MenuBelow"><img src="<?php echo my_url();?>images/below-menu.gif"></div>        
             </div>
		   <div class="title">
               <h1>Broker Contact List</h1>
            </div>                      
			<div class="module-index1">
		  		<div align="right"><a href="<?php echo base_url()?>admin/logout" style="color:#FF0000;">logout</a></div><br/>
  	                <p class=""><?php if (isset($recordflag)) {echo $recordflag;}?><p>
					<a href="<?php echo base_url() . "bc/add_bc/" ?>" >
						<img src=" <?php echo my_url() ."images/icons/action_add.gif" ?>" style='border:none'/> Add New Data
					</a>
			<br />
				<fieldset>  
                
              <div class="search_wrapper">
              
			<div class="searchfromloads">	            
            <form action="<?php echo base_url(); ?>bc/SearchFromLoads" method="post">

                  			<div class="border">
								<b>Load Search:</b>
							</div>	
                            						
							<div class="border1">                            
								<label>From_City:</label>
								<input type="text" name="search1" id="search1" value="" size="10" />
								<label>State:</label>
						        <?php require("f_state.php"); ?>
							</div>
                            
							<div id="margin" class="border1">                            
								<label>To_City:</label>
								<input type="text" name="search2" id="search2" value="" size="10" />
								<label>State:</label>
								 <?php require("t_state.php"); ?>
                                 
							</div>
							<div class="border_s">
								<input type="submit" value="Search" id="Search"  />
							</div>
             </form>
             </div>
             <div class="s">
             <form action="<?php echo base_url(); ?>bc/SearchBc" method="post">
			  <label><b>Search</b></label>
               <input type="text" name="search_value" id="search_value" value="" size="20" />
					<label><b>by:</b></label>
         <select id="column_value" name="column_value">	
						<?php if(isset($column_value)) {?>
								
								<?php if ($column_value=='') {?>
                                	<option value="" selected='selected'></option>                                
									<option value="bc_company_name">Company Name</option>
									<option value="city">City</option>
                                    <option value="state">State</option>
									<option value="concat(cell_phone_num,alt_phone_num,home_phone_num,fax_num)">Phone Number</option>
                                    <option value="mc_num">MC Number</option>

								<?php } if ($column_value=='bc_company_name') {?>	
                                	<option value=""></option>                                
									<option value="bc_company_name">Company Name</option>
									<option value="city">City</option>
                                    <option value="state">State</option>
									<option value="concat(cell_phone_num,alt_phone_num,home_phone_num,fax_num)">Phone Number</option>
                                    <option value="mc_num">MC Number</option>

								<?php } if ($column_value=='city') {?>	
                                  	<option value=""></option>
                                    <option value="bc_company_name">Company Name</option>
									<option value="city" selected="selected">City</option>
                                    <option value="state">State</option>
									<option value="concat(cell_phone_num,alt_phone_num,home_phone_num,fax_num)">Phone Number</option>
                                    <option value="mc_num">MC Number</option>


                                <?php } if ($column_value=='state') {?>	
                                  	<option value=""></option>
									<option value="bc_company_name">Company Name</option>
									<option value="city">City</option>
                                    <option value="state" selected="selected">State</option>
									<option value="concat(cell_phone_num,alt_phone_num,home_phone_num,fax_num)">Phone Number</option>
                                    <option value="mc_num">MC Number</option>
                 
                                <?php } if ($column_value=='concat(cell_phone_num,alt_phone_num,home_phone_num,fax_num)') {?>	
                                  	<option value=""></option>
									<option value="bc_company_name">Company Name</option>
									<option value="city">City</option>
                                    <option value="state" >State</option>
									<option value="concat(cell_phone_num,alt_phone_num,home_phone_num,fax_num)" selected="selected">Phone Number</option>
                                    <option value="mc_num">MC Number</option>

                                <?php } if ($column_value=='mc_mun)') {?>	
                                  	<option value=""></option>
									<option value="bc_company_name">Company Name</option>
									<option value="city">City</option>
                                    <option value="state">State</option>
									<option value="concat(cell_phone_num,alt_phone_num,home_phone_num,fax_num)">Phone Number</option>
                                    <option value="mc_num" selected="selected">MC Number</option>
                                    
								<?php }} else {?>
                                	<option value=""></option>
									<option value="bc_company_name">Company Name</option>
									<option value="city">City</option>
                                    <option value="state">State</option>
									<option value="concat(cell_phone_num,alt_phone_num,home_phone_num,fax_num)">Phone Number</option>
                                    <option value="mc_num">MC Number</option>
								<?php } ?>
					</select>                
					<input type="submit" value="Search" id="Search" />

		    </form>
            </div>
            <div class="sort_value">
            	<form action="<?php echo base_url(); ?>bc/ddlistsort" method="post">					
					<label><b>Sort by:</b></label>
						<select id="sort" name="sort">		
							<?php if(isset($sort)) {?>
								<?php if ($sort=='') {?>
									<option value="" selected="selected"></option>	
									<option value="bc_company_name">Company Name</option>
									<option value="profile_type">Profile Type</option>
									<option value="city">City</option>
									<option value="state">State</option>
									<option value="rep">Rep</option>
									<option value="email_add">Email address</option>

								<?php } if ($sort=='bc_company_name') {?>
									<option value=""></option>	
									<option value="bc_company_name" selected="selected">Company Name</option>
									<option value="profile_type">Profile Type</option>
									<option value="city">City</option>
									<option value="state">State</option>
									<option value="rep">Rep</option>
									<option value="email_add">Email address</option>
								
                                <?php } if ($sort=='profile_type') {?>
									<option value=""></option>	
									<option value="bc_company_name">Company Name</option>
									<option value="profile_type">Profile Type</option>
									<option value="city">City</option>
									<option value="state">State</option>
									<option value="rep">Rep</option>
									<option value="email_add">Email address</option>
								
								<?php } if ($sort=='city') {?>
									<option value=""></option>	
									<option value="bc_company_name">Company Name</option>
									<option value="profile_type">Profile Type</option>
									<option value="city" selected="selected">City</option>
									<option value="state">State</option>
									<option value="rep">Rep</option>
									<option value="email_add">Email address</option>
								
                                <?php } if ($sort=='state') {?>
									<option value=""></option>	
									<option value="bc_company_name">Company Name</option>
									<option value="profile_type">Profile Type</option>
									<option value="city">City</option>
									<option value="state" selected="selected">State</option>
									<option value="rep">Rep</option>
									<option value="email_add">Email address</option>

								<?php } if ($sort=='rep') {?>
									<option value=""></option>	
									<option value="bc_company_name">Company Name</option>
									<option value="profile_type">Profile Type</option>
									<option value="city">City</option>
									<option value="state" selected="selected">State</option>
									<option value="rep">Rep</option>
									<option value="email_add">Email address</option>
																                                                             																						
								<?php }if ($sort=='email_add'){ ?>
									<option value=""></option>	
									<option value="bc_company_name">Company Name</option>
									<option value="profile_type">Profile Type</option>
									<option value="city">City</option>
									<option value="state">State</option>
									<option value="rep">Rep</option>
									<option value="email_add" selected="selected">Email address</option>
																
								<?php }} else {?>
									<option value=""></option>	
									<option value="bc_company_name">Company Name</option>
									<option value="profile_type">Profile Type</option>
									<option value="city">City</option>
									<option value="state">State</option>
									<option value="rep">Rep</option>
									<option value="email_add">Email address</option>
								<?php } ?>
						</select> 
									
							<input type="submit" value="Go" id="Search" />
					 </form>
                 </div>
             </div>
			</fieldset>
            
          <br />		
                <div style='overflow:scroll;width:940px;height:400px;border:1pt solid #000;'>
                <table class='Grid' width='940px' border='1'>
                  <tr>
                       <th >View</th>
                        <th >Edit</th>
	 				    <th nowrap="nowrap">Profile Type</th>
                        <th nowrap="nowrap">B/C Company Name</th>
                        <th nowrap="nowrap">Nick Name</th>
                        <th nowrap="nowrap" colspan='2' >Full Name</th>
                        <th nowrap="nowrap">Address</th>
						<th nowrap="nowrap">City</th>						
						<th nowrap="nowrap">State</th>						
						<th nowrap="nowrap">Zipcode </th>						
                        <th nowrap="nowrap">Mobile Number</th>
						<th nowrap="nowrap">ALT Number</th>						
                        <th nowrap="nowrap">Office Number</th>
                        <th nowrap="nowrap">Fax Number</th>
						<th nowrap="nowrap">Email</th>
                        <th nowrap="nowrap">MC Number</th>
                        <th nowrap="nowrap">Rep.</th>
                        <th nowrap="nowrap">Comment</th>
                  </tr>
<?php
        		  $_rowClass = 'tr_odd';
                foreach($list_bcs as $row)
                {
                         $profile_type = $row->profile_type;
                         $bc_company_name = $row->bc_company_name;
                         $bc_n_name = $row->bc_n_name;
						 $f_name = $row->f_name;
						 $l_name = $row->l_name;
					     $address = $row->address;
                         $city = $row->city;
						 $state = $row->state;
						 $zipcode = $row->zipcode;
						 $cell_phone_num = $row->cell_phone_num;
						 $alt_phone_num = $row->alt_phone_num;
						 $office_phone_num = $row->office_phone_num;
						 $fax_num = $row->fax_num;						 
						 $email_add = $row->email_add;
						 $mc_num = $row->mc_num;
 						 $rep = $row->rep;
						 $bc_comment_box = $row->bc_comment_box;
?>					
					<tr class="<?php echo $_rowClass?>" " <?php echo GetTrEffects()?>">
                        <td width='5'>
                                <a href="<?php echo base_url() . "bc/view_bc/". $row->broker_code?>" >
                                <img src="<?php echo my_url() . "images/icons/view.gif" ?>" style='border:none'/></a>
						</td>
                        <td width='5'>
                        	<a href="<?php echo base_url() . "bc/edit_bc/" . $row->broker_code ?>">
                            	<img src="<?php echo my_url() . "images/icons/edit.gif" ?>" style='border:none' />
                             </a>
						</td>
    					<td nowrap="nowrap"><?php echo $profile_type ?></td>
                        <td nowrap="nowrap"><?php echo $bc_company_name?></td>
                        <td nowrap="nowrap"><?php echo $bc_n_name?></td>
                        <td nowrap="nowrap" colspan='2'> <?php echo $f_name.",&nbsp".$l_name?></td>
                        <td nowrap="nowrap"><?php echo $address?></td>
                        <td nowrap="nowrap"> <?php echo $city ?></td>
                        <td nowrap="nowrap"> <?php echo $state ?></td>
						<td nowrap="nowrap"> <?php echo $zipcode?></td>
						<td nowrap="nowrap"><?php echo $cell_phone_num?></td>
                        <td nowrap="nowrap"><?php echo $alt_phone_num?></td>						
                        <td nowrap="nowrap"><?php echo $office_phone_num?></td>
                        <td nowrap="nowrap"><?php echo $fax_num?></td>
						<td nowrap="nowrap"><?php echo $email_add?></td>
						<td nowrap="nowrap"><?php echo $mc_num?></td>
   						<td nowrap="nowrap"><?php echo $rep?></td>
						<td nowrap="nowrap"><?php echo $bc_comment_box?></td>                        
                  </tr>
<?php                  
				  if($_rowClass=="tr_odd") $_rowClass="tr_even"; else $_rowClass="tr_odd";     
                 }
?>
                 </table></div> 
    		<br>
            <div class="BodyContent">
            </div>	
		</div><!---end of ParentContent ---->
	    <div class="Footer1">	
               <div class="Footer">Copyright &copy; 2011. All Rights Reserved <br><br>
                 <a href="http://webmartis.com"> <img src="<?php echo my_url();?>images/wmlink.png"></a>
                 
                </div>                
            </div> <!---end of Footer1 ---->        
    </div> <!---end of BodyCover ---->
 

</body>

<?php } ?>

</html>



